package com.syxbbs.forum.dao;

import com.syxbbs.forum.model.Article;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    @Transactional
    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    //查询所有帖子列表
    List<Article> selectAll();

    //根据板块id查询
    List<Article> selectAllByBoardId(Long boardId);

    Article selectDetailById(Long id);

    //查询用户信息
    List<Article> selectByUserId(@RequestParam("userId") Long userId);




}